﻿using Microsoft.Extensions.DependencyInjection;
using Modules.BankSpecialAccount.Entitys;
using Modules.BankSpecialAccount.Repositories;
using PmSoft;

namespace Modules.BankSpecialAccount
{
    [UseDI(ServiceLifetime.Scoped)]
    public class BankSpecialAccountChangeStatusLogService
    {
        private readonly BankSpecialAccountChangeStatusLogRepository ProjectSpecialAccountChangeStatusLogRepository;

        public BankSpecialAccountChangeStatusLogService(BankSpecialAccountChangeStatusLogRepository ProjectSpecialAccountChangeStatusLogRepository)
        {
            this.ProjectSpecialAccountChangeStatusLogRepository = ProjectSpecialAccountChangeStatusLogRepository;
        }

        public void CreateProjectSpecialAccountChangeStatusLog(BankSpecialAccountChangeStatusLog entity)
        {
            ProjectSpecialAccountChangeStatusLogRepository.Insert(entity);
        }

        public void DeletProjectSpecialAccountChangeStatusLogs(IEnumerable<int> ids)
        {
            foreach (int id in ids)
                DeleteProjectSpecialAccountChangeStatusLog(id);
        }

        public void DeleteProjectSpecialAccountChangeStatusLog(int id)
        {
            ProjectSpecialAccountChangeStatusLogRepository.DeleteByEntityId(id);
        }

        public BankSpecialAccountChangeStatusLog? GetProjectSpecialAccountChangeStatusLog(int id)
        {
            return ProjectSpecialAccountChangeStatusLogRepository.Get(id);
        }

        public void UpdateProjectSpecialAccountChangeStatusLog(BankSpecialAccountChangeStatusLog entity)
        {
            ProjectSpecialAccountChangeStatusLogRepository.Update(entity);
        }
    }
}